function img_trapped(fbase, fnum, OmegaBounce)
%
%   img_trapped(fbase, fnum, OmegaBounce)
%
%   Reads file with density distribution.
%   Creates one images.
%
%   Input:
%        fbase   base of file number (runname)
%        fnum    file number
%
%   Domain information and colormap limits are edited in the file.
%   (OmegaBounce = 5.3 at t=2000 in the 2D test run)
%   (OmegaBounce = 3.9 at t=2000 in the 3D test run)


%---------------------------------------------------------

% system size

jx=48; jy=48; jz=16; jv=64; jdir=6;

% physics paramters

vmax=10; Lx=450; Ly=450; 
kz=0.34; nz=1; vPhase=3.53235; u0=1.24; phi00=0.01;
SpeckleWidth = 99.91139;

% colormap bounds

fzvmax = 0.01;

%---------------------------------------------------------
%-- reading density distribution

  fn = num2str(fnum,'%04d');

  fname = [fbase, '.dfu.', fn];

  fid = fopen(fname, 'rb');
  dfu = fread(fid, jv*jx*jy*jz*jdir, 'double');
  fclose(fid);

  dfu = reshape(dfu, jv,jz,jy,jx,jdir);

  dv = 2*vmax/jv;
  v  = (0:jv-1)*dv - vmax - vPhase;
  f0 = ( 1/sqrt(2*pi) )*exp( - 0.5*(v + vPhase).**2 );

%-- distrubution over velocities at the center --

  ix = jx/2+1;
  iy = jy/2+1;

  fzv =  sum(dfu(:,:,iy,ix, :),5);

  fzv =  fzv + meshgrid(f0, 1:jz)';

  vlimit = sqrt(2*OmegaBounce /SpeckleWidth/0.37233 /kz);

 
  indv = find( abs(v) < vlimit );

  fzv = fzv(indv, :);

  printf("trapped limits :        [%8.4f, %8.4f]\n",  min(min(fzv(:,:))), max(max(fzv(:,:))) )


  figure(7, "Name", "Trapped")
  imagesc(flipud(fzv))
  one_image(flipud(fzv), 0, fzvmax, [fbase, '.fvz.', fn, '.png' ])



%---------------------------------------------------------
